<template>
  <div>
    <p>
      工单模板名称:<input
        type="text"
        v-model="wf.title"
      >
    </p>
    <p>模板内容:
      <textarea v-model="wf.content">

      </textarea>
    </p>
    <button @click="set_template">提交模板</button>
  </div>
</template>

<script>
import Axios from 'axios'
export default {
  data() {
    return {
      token: localStorage.token || '',
      uid: localStorage.uid || '',
      title: '',
      template: '',
      wf: {
        title: '',
        content: ''
      }
    }
  },
  methods: {
    set_template() {
      Axios.post('template/', this.wf, {
        headers: {
          Authorization: 'JWT ' + this.token
        }
      }).then(resp => {
        console.log(resp)
      })
    }
  }
}
</script>

<style>
</style>